﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace InstantSpine.Core.MaterialModels
{
    /// <summary>
    /// A single fibrous layer of the annulus
    /// </summary>
    [DataContract]
    public sealed class AnnulusFiberLayer: MaterialViewModel
    {
        double? anteriorFiberAngle;
        [DataMember]
        public double? AnteriorFiberAngle {
            get { return anteriorFiberAngle; }
            set {
                if (value != anteriorFiberAngle) {
                    anteriorFiberAngle = value;
                    OnPropertyChanged();
                }
            }
        }

        double? posteriorFiberAngle;
        [DataMember]
        public double? PosteriorFiberAngle {
            get { return posteriorFiberAngle; }
            set {
                if (value != posteriorFiberAngle) {
                    posteriorFiberAngle = value;
                    OnPropertyChanged();
                }
            }
        }

        /// <summary>
        /// Material properties of the fibers contained in this layer
        /// </summary>
        [DataMember]
        public MarlowUniaxialMaterial FiberMaterialProperties { get; private set; }

        public AnnulusFiberLayer(string name = null): base(name) {
            FiberMaterialProperties = new MarlowUniaxialMaterial(name);            
        }

        public AnnulusFiberLayer(MarlowUniaxialMaterial fibermaterial, string name = null)
            : base(name) {
            FiberMaterialProperties = fibermaterial;
        }

        // required for XML serialization to work
        public AnnulusFiberLayer() : this(null) { }
    }
}
